package com.zpl.order.feign;

import com.zpl.core.Result;
import com.zpl.order.entity.Goods;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@Component
@FeignClient(value = "GOODS-SERVICE")
public interface GoodsFeign {
    @GetMapping("/goods/list/{id}")
    Result getGood(@PathVariable("id")Long id);

    @GetMapping("/goods/listfeign/{id}")
    Goods getGoodFeign(@PathVariable("id")Long id);

    @GetMapping("/goods/feignsearchtitle/{title}")
    List<Goods> searchTitle(@PathVariable("title") String title);

    @PutMapping("/goods")
    Result update(@RequestBody Goods goods);
}
